Integration Testing (IT)
Definition:
Testing the interface, bridge, or communication gateway between two or more modules or features is known as Integration Testing (IT).

Types of Integration Testing
1. Incremental Integration Testing
(a) Top-Down Integration Testing
(b) Bottom-Up Integration Testing

2. Non-Incremental Integration Testing
(a) Big Bang Integration Testing
(b) Sandwich Integration Testing

1. Incremental Integration Testing
(a) Top-Down Approach:
This approach is used when the data flows from higher-level modules to lower-level modules.
Arrange modules in a hierarchy where parent (higher-level) modules call the child (lower-level) modules.
Begin testing from the topmost module and integrate downward one by one.
Use Stubs to simulate lower modules if they are not yet developed.
Verify: Data flow from the higher module is successful and received correctly by the lower module.

(b) Bottom-Up Approach:
This approach is used when the data flows from lower-level modules to higher-level modules.
Begin with the testing of lower-level modules and gradually integrate and test higher-level modules.
Use Drivers to simulate higher modules if they are not yet developed.
Verify: Data flow from the lower module is successful and correctly received by the higher module.

2. Non-Incremental Integration Testing
(a) Big Bang Approach:
All modules are integrated simultaneously, and testing is performed on the entire system as a whole.
Typically done after all modules are individually developed.

Limitations of Testing:
High risk of missing interface defects due to simultaneous testing.
Difficult to isolate and identify the root cause of failures.
Time-consuming as all interfaces need to be tested together.

(b) Sandwich Approach (Hybrid Testing):
A combination of Top-Down and Bottom-Up approaches.

Testing is done on both top-level and bottom-level modules in parallel and later integrated with the middle-level modules.
Useful for large and complex systems with multiple dependencies.

Stub and Driver
Stub: A dummy lower-level module used in Top-Down testing to simulate the behavior of an undeveloped child module.

Driver: A dummy higher-level module used in Bottom-Up testing to simulate the behavior of an undeveloped parent module.

Q: Who provides the Stub or Driver?
A: The development team provides stubs and drivers to the QA team for testing purposes until the actual modules are developed.

Key Interview Example:
Q: There are 4 modules: A, B, C, D. What kind of integration testing will you perform?
A: First, analyze the dependency/relationship between modules. Based on that, determine whether to use Top-Down, Bottom-Up, or Sandwich approach.

System Integration Testing (SIT)
Definition:
Integration testing performed between two or more independent software systems is known as System Integration Testing.

Example:
Integration of Amazon application with external Payment Gateway (e.g., Razorpay, PayPal, or bank modules).